/*
 * networkedLocksTestZero.c
 *
 *  Created on: Jul 12, 2011
 *      Author: peckb1
 */

#include "syscall.h"

void
MVTester() {

    int arraySize = 5;
    int test = -1;
    int value = 0;

    int firstMVvalue  = CreateIntMV("First MV" , 8, arraySize);
    int secondMVvalue = CreateIntMV("Second MV", 8, arraySize);
    int thirdMVvalue  = CreateIntMV("Third MV" , 8, arraySize);
    int fourthMVvalue = CreateIntMV("Fourth MV", 8, arraySize);
        firstMVvalue  = CreateIntMV("First MV" , 8, arraySize);
        fourthMVvalue = CreateIntMV("Fourth MV", 8, arraySize);


    value = 100;
    AlterIntMV(firstMVvalue, 1, value);
    test = RetrieveIntMV(firstMVvalue, 1);
    if(test != value) {
        Exit(test);
    }

    value = 150;
    AlterIntMV(firstMVvalue, 1, value);
    test = RetrieveIntMV(firstMVvalue, 1);
    if(test != value) {
        Exit(test);
    }

    value = 250;
    AlterIntMV(firstMVvalue, 1, value);
    test = RetrieveIntMV(firstMVvalue, 1);
    if(test != value) {
        Exit(test);
    }

    value = 123;
    AlterIntMV(thirdMVvalue, 2, value);
    test = RetrieveIntMV(thirdMVvalue, 2);
    if(test != value) {
        Exit(test);
    }

    value = 432;
    AlterIntMV(thirdMVvalue, 2, value);
    test = RetrieveIntMV(thirdMVvalue, 2);
    if(test != value) {
        Exit(test);
    }

    value = 200;
    AlterIntMV(thirdMVvalue, 2, value);
    test = RetrieveIntMV(thirdMVvalue, 2);
    if(test != value) {
        Exit(test);
    }

    value = 450;
    AlterIntMV(fourthMVvalue, 0, value);
    test = RetrieveIntMV(fourthMVvalue, 0);
    if(test != value) {
        Exit(test);
    }

    value = 980;
    AlterIntMV(fourthMVvalue, 0, value);
    test = RetrieveIntMV(fourthMVvalue, 0);
    if(test != value) {
        Exit(test);
    }

    value = 659;
    AlterIntMV(fourthMVvalue, 1, value);
    test = RetrieveIntMV(fourthMVvalue, 1);
    if(test != value) {
        Exit(test);
    }

    Write("MV MAIN TEST OK\n", sizeof("MV MAIN TEST OK\n"), ConsoleOutput);

}

int main() {
    MVTester();

    Exit(0);
}
